package com.jsm.tf.net.command;

import com.jsm.tf.director.Director;
import com.jsm.tf.net.message.response.CreateRoomResponseMessage;
import com.jsm.tf.view.RoomView;
import io.netty.channel.Channel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class CreateRoomResponseCommand implements  Command<CreateRoomResponseMessage> {
    @Resource
    private Director director;
    @Override
    public void execute(CreateRoomResponseMessage message, Channel channel) {
        director.setRoom(message.getRoom());
        director.showView(RoomView.class);
    }
}
